package com.liyuhan;

import java.util.*;

public class Main{
    public static void main(String []args) {

        Scanner sc = new Scanner(System.in);

        while(sc.hasNext()){
            String input = sc.nextLine();
            String newInput = input.replaceAll("=", "");
            System.out.println("替换后的表达式：" + newInput);
            int result = getSum(newInput);
            System.out.println(result);
        }
    }

    public static int getSum(String param){
        int and = 0; // 标记+所在位置
        for(int i = 0; i < param.length(); i++){
            if('+' == param.charAt(i)){
                and = i;
            }
        }
        String left = param.substring(0, and).trim();
        String right = param.substring(and+1).trim();

        String l[] = left.split(" ");
        String r[] = right.split(" ");

        int ll = makeNum(l);
        int rr = makeNum(r);

        return ll+rr;
    }

    public static int makeNum(String a[]){
        if(a.length == 1){
            return change(a[0]);
        } else if(a.length == 2){
            return change(a[0])*10 + change(a[1]);
        } else {
            return 0;
        }
    }

    public static int change(String number){

        int result = 0 ;
        switch(number){
            case "zero":
                result = 0;
                break;
            case "one":
                result = 1;
                break;
            case "two":
                result = 2;
                break;
            case "three":
                result = 3;
                break;
            case "four":
                result = 4;
                break;
            case "five":
                result = 5;
                break;
            case "six":
                result = 6;
                break;
            case "seven":
                result = 7;
                break;
            case "eight":
                result = 8;
                break;
            case "nine":
                result = 9;
                break;
            default:
                break;
        }

        return result;
    }
}